import { request } from "umi";
import { TokenResult, R } from "./typings";

export async function login(body: any) {
    return request<R<TokenResult>>("/api/auth/login", {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        data: body,
    })
}

export async function refreshToken() {
    return request<R<TokenResult>>("/api/auth/refresh_token", {
        method: "GET"
    })
}
